home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / filutil / dp107e.zip / CHL.TIM < prev    next >
Text File  |  1995-02-22  |  4KB  |  95 lines

  1.  
  2.                     CHL  instructions
  3.          ( Simple instruction to describe symbol )
  4.  
  5. 1) Why CHL ?
  6.    There are two ways to draw a symbol.
  7.    a) Coding method : Lines of code are written into program to
  8.       draw a symbol. The major disadvantage of coding method is
  9.       that the program will be very large for each symbol need
  10.       a separate routine.
  11.    b) Image method : Symbols are store in image files (PCX, BMP,
  12.       MSP etc.). User can read in all kinds of symbol by using the
  13.       same routine. The disadvantage of image method is that it is
  14.       not easy to get a smooth image after enlargement or rotation.
  15.    To avoid the above two disadvantages, CHL use vector instructions
  16.    to describe a symbol. With Diskpaper, user can read in, rotate,
  17.    enlarge, stretch a symbol.
  18.  
  19. 2) Coordinate system of CHL.
  20.    CHL is a two dimension vector instruction set. The limitations of X and
  21.    Y are from -32000 to 32000.
  22.  
  23. 3) CHL instructions.
  24.        A) Parameters.
  25.    color/color1/color2/color3 : color to draw.
  26.    Fill/Border/Edge : the drawing method, fill the interior or not.
  27.    Set/And/Or/Xor(SAOX) : the bits operation of drawing.
  28.  
  29.        B) Instructions.
  30.      < : comment line.
  31.    SYS : With Diskpaper, SYS will set parameter color, F/B,
  32.          and SAOX to the corresponding flags defined in the Diskpaper.
  33.    SET : Set parameter SAOX to 'set'.
  34.    AND : Set parameter SAOX to 'and'.
  35.    OR  : Set parameter SAOX to 'or'.
  36.    XOR : Set parameter SAOX to 'xor'.
  37. BORDER : Set parameter BFE to 'border'.
  38.   FILL : Set parameter BFE to 'fill'.
  39.   EDGE : Set parameter BFE to 'edge'.
  40.  COLOR COLOR1 COLOR2 COLOR3 : Format as below
  41.           i) color1 k
  42.              You can define a color for drawing. k can be any value,
  43.              but Diskpaper has 7 colors only.
  44.          ii) color1 #n         n=1,2,3
  45.              With Diskpaper, you can set color to Dikpaper's
  46.              color1/color2/color3.
  47.   LINE : line x1,y1 ; x2,y2 ; x3,y3 ; ..... ; Xn, Yn
  48.          Draw an n-points line. You can split one row to a couple of rows.
  49.          line x1,y1 ; x2,y2 ; x3,y3 ;   ( ; means line continues )
  50.               X4,Y4 ; ..... ; Xi,Xi ;
  51.               Xl,Yl ; ..... ; Xm,Xm     ( line terminate here )
  52.  
  53.   POLY : POLY x1,y1 ; x2,y2 ; x3,y3 ; ..... ; Xn, Yn
  54.          3 <= n <= 500
  55.          Draw an n-points POLY.
  56.    SEC : sec x, y, rx, ry, d0, d1, d2
  57.          Draw a sector.
  58.          x, y : center point of sector.
  59.            rx : radius of x axis.
  60.            ry : radius of y axis.
  61.            d0 : start point of sector in degree.
  62.            d1 : end point of sector in degree.
  63.            d2 : rotatation degree.
  64.  
  65.          Note : A full ellipse will be draw, if d0 is equal to d1.
  66.  
  67.    ARC : arc x, y, rx, ry, d0, d1, d2
  68.          Draw a arc ( Similar to SEC ).
  69.  
  70. BEGINPOLY : Beginpoly and endpoly are dual instructions. You can put
  71.   ENDPOLY   line, arc, sec, poly instructions between them. Those in-
  72.             structions after BEGINPOLY will not be draw. All instructions
  73.             will be translate and store to a polygon array which has
  74.             500 entries. This polygon array will be draw till ENDPOLY
  75.             met. One thing is important, the SEC and ARC are translate
  76.             to an n-points polygon. To avoid array overflow (500), carefully
  77.             use SEC and ARC.
  78.             Example.
  79. BEGINPOLY
  80. < Upper large arc
  81. arc   16000,18000,8000,8000,-15,195,0
  82. < Left line
  83. line   9000,14000; 13000,9000; 13000,2000
  84. < Down small arc
  85. arc   16000,2000,3000,3000,180,360,0
  86. < Right line
  87. line  19000,2000; 19000,9000; 23000,14000
  88. ENDPOLY
  89.  
  90. 4) Read CHL file from Diskpaper.
  91.    You can select menu function   Xin -> CHL and define a rectangle
  92.    which maps to (0, 0) and (32000, 32000). Diskpaper will caculate
  93.    the ratio of X, Y, rotation degree and draw the Symbol.  No error
  94.    message will be show, if error found.
  95.